<?php

namespace SisGG\FinalBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use SisGG\FinalBundle\Entity\PedidoDelivery;
use SisGG\FinalBundle\Form\PedidoDeliveryType;
use SisGG\FinalBundle\Entity\ItemPedido;
use SisGG\FinalBundle\Form\ItemPedidoType;
use SisGG\FinalBundle\Entity\ProductoVenta;
use SisGG\FinalBundle\Form\ClienteType;
use SisGG\FinalBundle\Entity\Cliente;
use SisGG\FinalBundle\Entity\Ingrediente;
use SisGG\FinalBundle\Form\IngredienteType;
use SisGG\FinalBundle\Form\ProductoVentaType;

/**
 * Description of Pedido
 *
 * @author martin
 */
class PedidoController extends Controller {

    public function indexAction() {
        return new Response('Hello world!');
    }
    public function pedidosAction(){
        return $this->render('SisGGFinalBundle:Cajero:pedidos.html.twig',array('pedidoMostrador'=>null,'pedidoDelivery'=>null,'pedidoMesa'=>null));
    }
    public function nuevoPedidoDeliveryAction(){
         $pedidoDelivery = new PedidoDelivery();
         $clientes = $this->getDoctrine()->getEntityManager()->getRepository("SisGGFinalBundle:Cliente")->findAll();
         $provincias = $this->getDoctrine()->getEntityManager()->getRepository("SisGGFinalBundle:Provincia")->findAll();
         $formPedidoDelivery = $this->createForm(new PedidoDeliveryType(),$pedidoDelivery);
         $parameters = array('form'=>$formPedidoDelivery->createView(),'provincias'=>$provincias,'clientes'=>$clientes);
         return $this->render('SisGGFinalBundle:Default:nuevoPedidoDelivery.html.twig',$parameters);
    }
}